# Makefile for the TPIE include directory.
# $Id: Makefile.in,v 1.7 2002/01/03 18:32:19 tavi Exp $

CAT=cat
CP=cp
INDENT= 
INDENTFLAGS= 
PERL=
#ETAGS=etags

# Build the header file that will actually be used by using the
# C preprocessor to expand all of the macros in the source file.
# We can either use the macro definitions directly, or expand them and
# filter the results through GNU indent.  The latter approach makes 
# them more readable for debugging purposes, but since most people don't
# have GNU indent, the configure script turns it off by default.
EXPAND_AMI_SCAN_H = no

# Public targets.

all: ami_scan.h

clean:
	-rm -f ami_scan.h

distclean: clean

# Private targets.

ifeq ($(EXPAND_AMI_SCAN_H),yes)
ami_scan.h: ami_scan_mac.cpp ami_scan_mac.h ami_scan.h.head ami_scan.h.tail
	$(CAT) ami_scan.h.head > $@
	$(CXX) -E $< | $(INDENT) $(INDENTFLAGS) - | grep -v "^#" | \
	    $(PERL) -e \
	    'while (<>) { print "\n" if /template/; print if /.+/; }' >> $@
	$(CAT) ami_scan.h.tail >> $@
else
ami_scan.h: ami_scan_mac.h ami_scan.h.head ami_scan.h.tail
	cat ami_scan.h.head ami_scan_mac.h ami_scan.h.tail > $@
endif

.PHONY : all clean

